export function getProcessArgIn<T extends string>(value: string, values: T[]): T | undefined {
  if (!value || !values || values.length === 0) return undefined;
  for (let v of values) {
    if (v === value) return v;
  }
  return undefined;
}

export function getProcessArg(key: string): string | undefined {
  let matchResult = process.argv.filter(s => s.match(`--${key}=`));
  if (!matchResult || matchResult.length === 0) return undefined;
  return matchResult[0].match(`--${key}=(.*)`)?.[1];
}
